-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add (untested) SWIG interface file for Java bindings #427
base: master
Are you sure you want to change the base?
Conversation
I like this approach. I've been working to get this to compile a golang binding. There are just a couple of incompatibilities, but the biggest thing is this:
It seems like Swig doesn't support converting nested struct's at this time. We could always flatten it, or use something else |
@RyanGordon you can still pass the nested structs around as opaque objects, which should be sufficient for most use cases... |
@floe That is what I hoped too, but when I go to compile the generated golang code, I end up with this:
|
Hm, this does look more like a linker problem to me? E.g. the fact that it can't find |
#490 has been merged, do your Go bindings work now? |
@floe Not quite, it looks like we use a variable called "type" in a couple of places, but that is a reserved symbol in Go and SWIG isn't smart enough to rename it. Should I make a separate PR for that change? |
If it's part of a public interface, then it probably needs to be renamed. Otherwise, SWIG can also be told to explicitly rename certain identifiers. |
It looks like the "type" argument on "OnNewFrame" is causing the trouble. I was able to rename it by adding "#define type _type" to the SWIG file. I'm now getting a bunch of linking errors. I'll try working through some of them but not sure how far I'll get tonight. |
In order for this to be merged, we need at least one test case in Go or Java. |
I'd go with Java, as that would open up the route to Processing. Haven't done a lot with that recently, though. |
I've tried to get it working in Go but I keep getting stuck - Converting to go with SWIG is pretty messy and doesn't seem to compile due to reversed keywords being used and other syntax problems that seem to be not straightforward to fix |
Yeah, I think support for Go in SWIG is still pretty fresh, and Java is more mature. I'd suggest to get Java running first, and then see how other languages can be added. |
Starting point for fixing #417, not yet finished & untested. /cc @jonnius @xlz